home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / DigitalSignature.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  18.0 KB  |  540 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        DigitalSignature.a
  3. ;
  4. ;    Contains:    Digital Signature Interfaces.
  5. ;
  6. ;    Version:    Technology:    AOCE toolbox 1.02
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__DIGITALSIGNATURE__') = 'UNDEFINED' THEN
  21. __DIGITALSIGNATURE__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  30.     include 'Memory.a'
  31.     ENDIF
  32. ;        include 'MixedMode.a'                                        ;
  33.  
  34.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  35.     include 'Files.a'
  36.     ENDIF
  37. ;        include 'OSUtils.a'                                        ;
  38.  
  39. kSIGNewContext                    EQU        1900
  40. kSIGDisposeContext                EQU        1901
  41. kSIGSignPrepare                    EQU        1902
  42. kSIGSign                        EQU        1903
  43. kSIGVerifyPrepare                EQU        1904
  44. kSIGVerify                        EQU        1905
  45. kSIGDigestPrepare                EQU        1906
  46. kSIGDigest                        EQU        1907
  47. kSIGProcessData                    EQU        1908
  48. kSIGShowSigner                    EQU        1909
  49. kSIGGetSignerInfo                EQU        1910
  50. kSIGGetCertInfo                    EQU        1911
  51. kSIGGetCertNameAttributes        EQU        1912
  52. kSIGGetCertIssuerNameAttributes    EQU        1913
  53. kSIGFileIsSigned                EQU        2500
  54. kSIGSignFile                    EQU        2501
  55. kSIGVerifyFile                    EQU        2502
  56.  
  57. kSIGCountryCode                    EQU        0
  58. kSIGOrganization                EQU        1
  59. kSIGStreetAddress                EQU        2
  60. kSIGState                        EQU        3
  61. kSIGLocality                    EQU        4
  62. kSIGCommonName                    EQU        5
  63. kSIGTitle                        EQU        6
  64. kSIGOrganizationUnit            EQU        7
  65. kSIGPostalCode                    EQU        8
  66.  
  67. ; typedef unsigned short     SIGNameAttributeType
  68. ;Certificate status codes returned in SIGCertInfo or SIGSignerInfo from
  69. ;either SIGGetCertInfo or SIGGetSignerInfo respectively. kSIGValid means that
  70. ;the certificate is currently valid. kSIGPending means the certificate is
  71. ;currently not valid - but will be.  kSIGExpired means the certificate has
  72. ;expired. A time is always associated with a SIGCertStatus.  In each case the
  73. ;time has a specific interpretation.  When the status is kSIGValid the time is
  74. ;when the certificate will expire. When the status is kSIGPending the time is
  75. ;when the certificate will become valid. When the status is kSIGExpired the time
  76. ;is when the certificate expired. In the SIGCertInfo structure, the startDate
  77. ;and endDate fields hold the appropriate date information.  In the SIGSignerInfo
  78. ;structure, this information is provided in the certSetStatusTime field. In the
  79. ;SIGSignerInfo struct, the status time is actually represented by the SIGSignatureStatus
  80. ;field which can contain any of the types below. NOTE: The only time you will get 
  81. ;a kSIGInvalid status is when it pertains to a SIGSignatureStatus field and only when
  82. ;you get a signature that was created after the certificates expiration date, something
  83. ;we are not allowing on the Mac but that may not be restricted on other platforms. Also, 
  84. ;it will not be possible to get a kSIGPending value for SIGSignatureStatus on the Mac but
  85. ;possibly allowed by other platforms.
  86. ;
  87. ; Values for SIGCertStatus or SIGSignatureStatus 
  88.  
  89. kSIGValid                        EQU        0                    ; possible for either a SIGCertStatus or SIGSignatureStatus 
  90. kSIGPending                        EQU        1                    ; possible for either a SIGCertStatus or SIGSignatureStatus 
  91. kSIGExpired                        EQU        2                    ; possible for either a SIGCertStatus or SIGSignatureStatus
  92. ;    * possible only for a SIGSignatureStatus 
  93. kSIGInvalid                        EQU        3
  94.  
  95. ; typedef unsigned short     SIGCertStatus
  96. ; typedef unsigned short     SIGSignatureStatus
  97. ; Gestalt selector code - returns toolbox version in low-order word 
  98.  
  99. gestaltDigitalSignatureVersion    EQU        'dsig'
  100.  
  101. ; Number of bytes needed for a digest record when using SIGDigest 
  102. kSIGDigestSize                    EQU        16
  103.  
  104. ; typedef Byte                 SIGDigestData[kSIGDigestSize], *SIGDigestDataPtr
  105. SIGCertInfo             RECORD    0
  106. startDate                 ds.l   1        ; offset: $0 (0)        ; cert start validity date 
  107. endDate                     ds.l   1        ; offset: $4 (4)        ; cert end validity date 
  108. certStatus                 ds.w   1        ; offset: $8 (8)        ; see comment on SIGCertStatus for definition 
  109. certAttributeCount         ds.l   1        ; offset: $A (10)        ; number of name attributes in this cert 
  110. issuerAttributeCount     ds.l   1        ; offset: $E (14)        ; number of name attributes in this certs issuer 
  111. serialNumber             ds.l   64        ; offset: $12 (18)        ; cert serial number 
  112. sizeof                     EQU *            ; size:   $112 (274)
  113.                         ENDR
  114.  
  115. ; typedef struct SIGCertInfo  SIGCertInfo
  116. ; typedef SIGCertInfo         *SIGCertInfoPtr
  117. SIGSignerInfo             RECORD    0
  118. signingTime                 ds.l   1        ; offset: $0 (0)        ; time of signing 
  119. certCount                 ds.l   1        ; offset: $4 (4)        ; number of certificates in the cert set 
  120. certSetStatusTime         ds.l   1        ; offset: $8 (8)        ; Worst cert status time. See comment on SIGCertStatus for definition 
  121. signatureStatus             ds.w   1        ; offset: $C (12)        ; The status of the signature. See comment on SIGCertStatus for definition
  122. sizeof                     EQU *            ; size:   $E (14)
  123.                         ENDR
  124.  
  125. ; typedef struct SIGSignerInfo  SIGSignerInfo
  126. ; typedef SIGSignerInfo     *SIGSignerInfoPtr
  127. SIGNameAttributesInfo     RECORD    0
  128. onNewLevel                 ds.b   1        ; offset: $0 (0)
  129. filler1                     ds.b   1        ; offset: $1 (1)
  130. attributeType             ds.w   1        ; offset: $2 (2)
  131. attributeScript             ds.w   1        ; offset: $4 (4)
  132. attribute                 ds.l   64        ; offset: $6 (6)
  133. sizeof                     EQU *            ; size:   $106 (262)
  134.                         ENDR
  135.  
  136. ; typedef struct SIGNameAttributesInfo  SIGNameAttributesInfo
  137. ; typedef SIGNameAttributesInfo  *SIGNameAttributesInfoPtr
  138. ; typedef Ptr                 SIGContextPtr
  139. ; typedef Ptr                 SIGSignaturePtr
  140. ;
  141. ;Certificates are always in order. That is, the signers cert is always 0, the
  142. ;issuer of the signers cert is always 1 etc… to the number of certificates-1.
  143. ;You can use this constant for readability in your code.
  144. ;
  145.  
  146. kSIGSignerCertIndex                EQU        0
  147.  
  148. ;
  149. ;Call back procedure supplied by developer, return false to cancel the current
  150. ;process.
  151. ;
  152. ;
  153. ;Resource id's of standard signature icon suite, all sizes and colors are available.
  154. ;
  155. kSIGSignatureIconResID            EQU        -16800
  156. kSIGValidSignatureIconResID        EQU        -16799
  157. kSIGInvalidSignatureIconResID    EQU        -16798
  158.  
  159. ; ——————————————————————————————— CONTEXT CALLS ——————————————————————————————— 
  160. ;To use the Digital Signature toolbox you will need a SIGContextPtr.  To create
  161. ;a SIGContextPtr you simply call SIGNewContext and it will create and initialize
  162. ;a context for you.  To free the memory occupied by the context and invalidate
  163. ;its internal data, call SIGDisposeContext. An initialized context has no notion
  164. ;of the type of operation it will be performing however, once you call
  165. ;SIGSignPrepare SIGVerifyPrepare, or SIGDigestPrepare, the contexts operation
  166. ;type is set and to switch  to another type of operation will require creating a
  167. ;new context. Be sure to pass the same context to corresponding toolbox calls
  168. ;(ie SIGSignPrepare, SIGProcessData, SIGSign)  in other words mixing lets say
  169. ;signing and verify calls with the same context is not allowed.
  170. ;
  171. ;
  172. ; pascal OSErr SIGNewContext(SIGContextPtr *context)
  173. ;
  174.     IF ¬ GENERATINGCFM THEN
  175.         Macro
  176.         _SIGNewContext
  177.             dc.w     $203C
  178.             dc.w     $0002
  179.             dc.w     $076C
  180.             dc.w     $AA5D
  181.         EndM
  182.     ELSE
  183.         IMPORT_CFM_FUNCTION    SIGNewContext
  184.     ENDIF
  185.  
  186. ;
  187. ; pascal OSErr SIGDisposeContext(SIGContextPtr context)
  188. ;
  189.     IF ¬ GENERATINGCFM THEN
  190.         Macro
  191.         _SIGDisposeContext
  192.             dc.w     $203C
  193.             dc.w     $0002
  194.             dc.w     $076D
  195.             dc.w     $AA5D
  196.         EndM
  197.     ELSE
  198.         IMPORT_CFM_FUNCTION    SIGDisposeContext
  199.     ENDIF
  200.  
  201. ; ——————————————————————————————— SIGNING CALLS ——————————————————————————————— 
  202. ;Once you have created a SIGContextPtr, you create a signature by calling
  203. ;SIGSignPrepare once, followed by n calls to SIGProcessData, followed by one call
  204. ;toRcpt SIGSign. To create another signature on different data but for the same
  205. ;signer, don't dispose of the context and call SIGProcessData for the new data
  206. ;followed by a call SIGSign again. In this case the signer will not be prompted
  207. ;for their signer and password again as it was already provided.  Once you call
  208. ;SIGDisposeContext, all signer information will be cleared out of the context and
  209. ;the signer will be re-prompted.  The signer file FSSpecPtr should be set to nil
  210. ;if you want the toolbox to use the last signer by default or prompt for a signer
  211. ;if none exists.  The prompt parameter can be used to pass a string to be displayed
  212. ;in the dialog that prompts the user for their password.  If the substring "^1"
  213. ;(without the quotes) is in the prompt string, then the toolbox will replace it
  214. ;with the name of the signer from the signer selected by the user.  If an empty
  215. ;string is passed, the following default string will be sent to the toolbox
  216. ;"\pSigning as ^1.".  You can call any of the utility routines after SIGSignPrepare
  217. ;or SIGSign to get information about the signer or certs.
  218. ;
  219. ;
  220. ; pascal OSErr SIGSignPrepare(SIGContextPtr context, const FSSpec *signerFile, ConstStr255Param prompt, Size *signatureSize)
  221. ;
  222.     IF ¬ GENERATINGCFM THEN
  223.         Macro
  224.         _SIGSignPrepare
  225.             dc.w     $203C
  226.             dc.w     $0008
  227.             dc.w     $076E
  228.             dc.w     $AA5D
  229.         EndM
  230.     ELSE
  231.         IMPORT_CFM_FUNCTION    SIGSignPrepare
  232.     ENDIF
  233.  
  234. ;
  235. ; pascal OSErr SIGSign(SIGContextPtr context, SIGSignaturePtr signature, SIGStatusUPP statusProc)
  236. ;
  237.     IF ¬ GENERATINGCFM THEN
  238.         Macro
  239.         _SIGSign
  240.             dc.w     $203C
  241.             dc.w     $0006
  242.             dc.w     $076F
  243.             dc.w     $AA5D
  244.         EndM
  245.     ELSE
  246.         IMPORT_CFM_FUNCTION    SIGSign
  247.     ENDIF
  248.  
  249. ; ——————————————————————————————— VERIFYING CALLS ——————————————————————————————— 
  250. ;Once you have created a SIGContextPtr, you verify a signature by calling
  251. ;SIGVerifyPrepare  once, followed by n calls to SIGProcessData, followed by one
  252. ;call to SIGVerify. Check the return code from SIGVerify to see if the signature
  253. ;verified or not (noErr is returned on  success otherwise the appropriate error
  254. ;code).  Upon successfull verification, you can call any of the utility routines
  255. ;toRcpt find out who signed the data.
  256. ;
  257. ;
  258. ; pascal OSErr SIGVerifyPrepare(SIGContextPtr context, SIGSignaturePtr signature, Size signatureSize, SIGStatusUPP statusProc)
  259. ;
  260.     IF ¬ GENERATINGCFM THEN
  261.         Macro
  262.         _SIGVerifyPrepare
  263.             dc.w     $203C
  264.             dc.w     $0008
  265.             dc.w     $0770
  266.             dc.w     $AA5D
  267.         EndM
  268.     ELSE
  269.         IMPORT_CFM_FUNCTION    SIGVerifyPrepare
  270.     ENDIF
  271.  
  272. ;
  273. ; pascal OSErr SIGVerify(SIGContextPtr context)
  274. ;
  275.     IF ¬ GENERATINGCFM THEN
  276.         Macro
  277.         _SIGVerify
  278.             dc.w     $203C
  279.             dc.w     $0002
  280.             dc.w     $0771
  281.             dc.w     $AA5D
  282.         EndM
  283.     ELSE
  284.         IMPORT_CFM_FUNCTION    SIGVerify
  285.     ENDIF
  286.  
  287. ; —————————————————————————————— DIGESTING CALLS —————————————————————————————— 
  288. ;Once you have created a SIGContextPtr, you create a digest by calling
  289. ;SIGDigestPrepare once, followed by n calls to SIGProcessData, followed by one
  290. ;call to SIGDigest.  You can dispose of the context after SIGDigest as the
  291. ;SIGDigestData does not reference back into it.  SIGDigest returns the digest in
  292. ;digest.
  293. ;
  294. ;
  295. ; pascal OSErr SIGDigestPrepare(SIGContextPtr context)
  296. ;
  297.     IF ¬ GENERATINGCFM THEN
  298.         Macro
  299.         _SIGDigestPrepare
  300.             dc.w     $203C
  301.             dc.w     $0002
  302.             dc.w     $0772
  303.             dc.w     $AA5D
  304.         EndM
  305.     ELSE
  306.         IMPORT_CFM_FUNCTION    SIGDigestPrepare
  307.     ENDIF
  308.  
  309. ;
  310. ; pascal OSErr SIGDigest(SIGContextPtr context, SIGDigestData digest)
  311. ;
  312.     IF ¬ GENERATINGCFM THEN
  313.         Macro
  314.         _SIGDigest
  315.             dc.w     $203C
  316.             dc.w     $0004
  317.             dc.w     $0773
  318.             dc.w     $AA5D
  319.         EndM
  320.     ELSE
  321.         IMPORT_CFM_FUNCTION    SIGDigest
  322.     ENDIF
  323.  
  324. ; —————————————————————————————— PROCESSING DATA —————————————————————————————— 
  325. ;To process data during a digest, sign, or verify operation call SIGProcessData
  326. ;as many times as necessary and with any sized blocks of data.  The data needs to
  327. ;be processed in the same order during corresponding sign and verify operations
  328. ;but does not need to be processed in the same sized chunks (i.e., the toolbox
  329. ;just sees it as a continuous bit stream).
  330. ;
  331. ;
  332. ; pascal OSErr SIGProcessData(SIGContextPtr context, const void *data, Size dataSize)
  333. ;
  334.     IF ¬ GENERATINGCFM THEN
  335.         Macro
  336.         _SIGProcessData
  337.             dc.w     $203C
  338.             dc.w     $0006
  339.             dc.w     $0774
  340.             dc.w     $AA5D
  341.         EndM
  342.     ELSE
  343.         IMPORT_CFM_FUNCTION    SIGProcessData
  344.     ENDIF
  345.  
  346. ; ——————————————————————————————— UTILITY CALLS ——————————————————————————————— 
  347. ;Given a context that has successfully performed a verification SIGShowSigner
  348. ;will  display a modal dialog with the entire distinguished name of the person
  349. ;who signed the data. the prompt (if supplied) will appear at the top of the
  350. ;dialog.  If no prompt is specified, the default prompt "\pVerification
  351. ;Successfull." will appear.
  352. ;
  353. ;Given a context that has been populated by calling SIGSignPrepare, SIGSign or a
  354. ;successful SIGVerify, you can make the remaining utility calls:
  355. ;
  356. ;SIGGetSignerInfo will return the SignerInfo record.  The certCount can be used
  357. ;toRcpt index into the certificate set when calling SIGGetCertInfo,
  358. ;SIGGetCertNameAttributes or SIGGetCertIssuerNameAttributes. The signingTime is
  359. ;only defined if the call is made after SIGSign  or SIGVerify. The certSetStatus
  360. ;will tell you the best status of the entire certificate set while
  361. ;certSetStatusTime will correspond to the time associated with that status (see
  362. ;definitions above).
  363. ;
  364. ;SIGGetCertInfo will return the SIGCertInfo record when given a valid index into
  365. ;the cert set in  certIndex.  Note: The cert at index kSIGSignerCertIndex is
  366. ;always the signers certificate.  The  serial number, start date and end date
  367. ;are there should you wish to display that info.  The  certAttributeCount and
  368. ;issuerAttributeCount provide the number of parts in the name of that certificate
  369. ;or that certificates issuer respectively.  You use these numbers to index into
  370. ;either SIGGetCertNameAttributes or SIGGetCertIssuerNameAttributes to retrieve
  371. ;the name. The certStatus will tell you the status of the certificate while
  372. ;certStatusTime will correspond to the time associated with that status (see
  373. ;definitions above).
  374. ;
  375. ;SIGGetCertNameAttributes and SIGGetCertIssuerNameAttributes return name parts
  376. ;of the certificate at  certIndex and attributeIndex.  The newLevel return value
  377. ;tells you wether the name attribute returned is at the same level in the name
  378. ;hierarchy as the previous attribute.  The type return value tells you  the type
  379. ;of attribute returned. nameAttribute is the actual string containing the name
  380. ;attribute.   So, if you wanted to display the entire distinguished name of the
  381. ;person who's signature was just validated you could do something like this;
  382. ;
  383. ;    (…… variable declarations and verification code would preceed this sample ……)
  384. ;
  385. ;    error = SIGGetCertInfo(verifyContext, kSIGSignerCertIndex, &certInfo);
  386. ;    HandleErr(error);
  387. ;
  388. ;    for (i = 0; i <= certInfo.certAttributeCount-1; i++)
  389. ;        {
  390. ;        error = SIGGetCertNameAttributes(
  391. ;            verifyContext, kSIGSignerCertIndex, i, &newLevel, &type, theAttribute);
  392. ;        HandleErr(error);
  393. ;        DisplayNamePart(theAttribute, type, newLevel);
  394. ;        }
  395. ;
  396. ;
  397. ; pascal OSErr SIGShowSigner(SIGContextPtr context, ConstStr255Param prompt)
  398. ;
  399.     IF ¬ GENERATINGCFM THEN
  400.         Macro
  401.         _SIGShowSigner
  402.             dc.w     $203C
  403.             dc.w     $0004
  404.             dc.w     $0775
  405.             dc.w     $AA5D
  406.         EndM
  407.     ELSE
  408.         IMPORT_CFM_FUNCTION    SIGShowSigner
  409.     ENDIF
  410.  
  411. ;
  412. ; pascal OSErr SIGGetSignerInfo(SIGContextPtr context, SIGSignerInfo *signerInfo)
  413. ;
  414.     IF ¬ GENERATINGCFM THEN
  415.         Macro
  416.         _SIGGetSignerInfo
  417.             dc.w     $203C
  418.             dc.w     $0004
  419.             dc.w     $0776
  420.             dc.w     $AA5D
  421.         EndM
  422.     ELSE
  423.         IMPORT_CFM_FUNCTION    SIGGetSignerInfo
  424.     ENDIF
  425.  
  426. ;
  427. ; pascal OSErr SIGGetCertInfo(SIGContextPtr context, unsigned long certIndex, SIGCertInfo *certInfo)
  428. ;
  429.     IF ¬ GENERATINGCFM THEN
  430.         Macro
  431.         _SIGGetCertInfo
  432.             dc.w     $203C
  433.             dc.w     $0006
  434.             dc.w     $0777
  435.             dc.w     $AA5D
  436.         EndM
  437.     ELSE
  438.         IMPORT_CFM_FUNCTION    SIGGetCertInfo
  439.     ENDIF
  440.  
  441. ;
  442. ; pascal OSErr SIGGetCertNameAttributes(SIGContextPtr context, unsigned long certIndex, unsigned long attributeIndex, SIGNameAttributesInfo *attributeInfo)
  443. ;
  444.     IF ¬ GENERATINGCFM THEN
  445.         Macro
  446.         _SIGGetCertNameAttributes
  447.             dc.w     $203C
  448.             dc.w     $0008
  449.             dc.w     $0778
  450.             dc.w     $AA5D
  451.         EndM
  452.     ELSE
  453.         IMPORT_CFM_FUNCTION    SIGGetCertNameAttributes
  454.     ENDIF
  455.  
  456. ;
  457. ; pascal OSErr SIGGetCertIssuerNameAttributes(SIGContextPtr context, unsigned long certIndex, unsigned long attributeIndex, SIGNameAttributesInfo *attributeInfo)
  458. ;
  459.     IF ¬ GENERATINGCFM THEN
  460.         Macro
  461.         _SIGGetCertIssuerNameAttributes
  462.             dc.w     $203C
  463.             dc.w     $0008
  464.             dc.w     $0779
  465.             dc.w     $AA5D
  466.         EndM
  467.     ELSE
  468.         IMPORT_CFM_FUNCTION    SIGGetCertIssuerNameAttributes
  469.     ENDIF
  470.  
  471. ; ——————————————————————————— FILE SIGN & VERIFY CALLS —————————————————————————— 
  472. ;These calls allow you to detect the presence of a standard signtaure in a file as 
  473. ;well as sign and verify files in a standard way.  An example of this is the Finder, 
  474. ;which uses these calls to allow the user to "drop sign" a file.
  475. ;
  476. ;To detect if a file is signed in the standard way, pass the FSSpec of the file to SIGFileIsSigned.
  477. ;A result of noErr means the file is in fact signed, otherwise, a kSIGNoSignature error will
  478. ;be returned.
  479. ;
  480. ;Once you have created a SIGContextPtr, you can make calls to either sign or verify a file in
  481. ;a standard way: 
  482. ;
  483. ;To sign a file, call SIGSignPrepare followed by 'n' number of calls to SIGSignFile,
  484. ;passing it the file spec for each file you wish to sign in turn.  You supply the context, the signature 
  485. ;size that was returned from SIGSignPrepare and an optional call back proc.  The call will take care of all
  486. ;the processing of data and affixing the signature to the file. If a signature already exists in the file, 
  487. ;it is replaced with the newly created signature.
  488. ;
  489. ;To verify a file that was signed using SIGSignFile, call SIGVerifyFile passing it a new context and 
  490. ;the file spec.  Once this call has completed, if the verification is successfull, you can pass the context 
  491. ;to SIGShowSigner to display the name of the person who signed the file.
  492. ;
  493. ;
  494. ; pascal OSErr SIGFileIsSigned(const FSSpec *fileSpec)
  495. ;
  496.     IF ¬ GENERATINGCFM THEN
  497.         Macro
  498.         _SIGFileIsSigned
  499.             dc.w     $203C
  500.             dc.w     $0002
  501.             dc.w     $09C4
  502.             dc.w     $AA5D
  503.         EndM
  504.     ELSE
  505.         IMPORT_CFM_FUNCTION    SIGFileIsSigned
  506.     ENDIF
  507.  
  508. ;
  509. ; pascal OSErr SIGSignFile(SIGContextPtr context, Size signatureSize, const FSSpec *fileSpec, SIGStatusUPP statusProc)
  510. ;
  511.     IF ¬ GENERATINGCFM THEN
  512.         Macro
  513.         _SIGSignFile
  514.             dc.w     $203C
  515.             dc.w     $0008
  516.             dc.w     $09C5
  517.             dc.w     $AA5D
  518.         EndM
  519.     ELSE
  520.         IMPORT_CFM_FUNCTION    SIGSignFile
  521.     ENDIF
  522.  
  523. ;
  524. ; pascal OSErr SIGVerifyFile(SIGContextPtr context, const FSSpec *fileSpec, SIGStatusUPP statusProc)
  525. ;
  526.     IF ¬ GENERATINGCFM THEN
  527.         Macro
  528.         _SIGVerifyFile
  529.             dc.w     $203C
  530.             dc.w     $0006
  531.             dc.w     $09C6
  532.             dc.w     $AA5D
  533.         EndM
  534.     ELSE
  535.         IMPORT_CFM_FUNCTION    SIGVerifyFile
  536.     ENDIF
  537.  
  538.     ENDIF ; __DIGITALSIGNATURE__
  539.